<extend name="index::index" />
<block name="title"><title>order</title></block>
<block name="nav">
	<ul class="list-unstyled list">
		<empty name="login">
			<li>
			<a href="{:U('Index/login')}" class="anchorLink"><i class="icon-road scolor"></i>登录</a>
			</li>
			<li>
			<a href="{:U('Index/reg')}" class="anchorLink"><i class="icon-road scolor"></i>注册</a>
			</li>
			<else />
			<li>
			<a href="{:U('User/index',['id'=>$login['id']])}" style="text-transform:none;"><i class="icon-road scolor"></i><span style="color:#fff;">欢迎{$login['name']}</span></a>
			</li>
			<li>
			<a href="{:U('Index/loginout')}" class="anchorLink"><i class="icon-road scolor"></i>退出</a>
			</li>
		</empty>
		<li><a href="{:U('Index/index')}" class="anchorLink"><i class="icon-home scolor"></i>主页</a></li>
	</ul>
</block>
<block name="addver">
</block>
<block name="team">
</block>
<block name="main">
	<div class="team"><h3>地址管理</h3></div>
	<div class="bor hidden-xs"></div>
	<a href="{:U('Order/address')}" style="width:200px;height:40px;border:none;background:#DB453E;float:left;text-align:center;line-height:40px;color:#fff;display:block;text-decoration:none;">添加地址</a>
	<div style="min-height:200px;">
	<table class="table" border="1" cellspacing="0" cellpadding="5" align="center">
        <tr bgcolor="#ccc">
          <th>收货地址</th>
          <th>操作</th>
        </tr>  
        <form action="{:U('order/doorder')}"  method="post">
        <foreach name="data" item="value">
        <notempty name="value">      
        <tr>
          <td><input type="radio" name="address" value="{$value['id']}"/>{$value['address']}</td>
          <td><a href="{:U('Order/dele',['id'=>$value['id']])}">删除</a></td>
        </tr>
        </notempty>
        </foreach>
     </table>
    </div>
    <div class="team"><h3>订单管理</h3></div> 
	<div class="bor hidden-xs"></div>
	<div style="min-height:400px;">
  <br/>
  <a href="{:U('Index/index')}" style="width:200px;height:40px;border:none;background:#DB453E;float:left;text-align:center;line-height:40px;color:#fff;display:block;text-decoration:none;">继续购物</a>
	 <table class="table" border="1" cellspacing="0" cellpadding="5" align="center">
        <tr bgcolor="#ccc">
          <th>宝贝</th>
          <th>图片</th>
          <th>价格</th>
          <th>数量</th>
          <th>小计</th>
          <th>删除</th>
        </tr>  
        <foreach name="list" item="val">
        <notempty name="val">      
        <tr>
          <td>{$val['gname']}</td>
          <td><img src="__ROOT__{$val['giname']}" alt="" ></td>
          <td>
          ￥:{$val['gp']}
          </td>
          <td>
			<button onclick="return false" style="width:40px;height:40px;border:none;background:#ccc;">-</button>
			<input id="num" name="num"  value="{$val['num']}"  style="width:40px;height:40px;"  type="text" />
			<button onclick="return false"  style="width:40px;height:40px;border:none;background:#ccc;">+</button>
          </td>
          <td>￥:{$val['num']*$val['gp']}</td>
          <td><a href="{:U('Order/del',['id'=>$val['gid']])}">删除</a></td>
        </tr>
        </notempty>
        </foreach>
        <tr>
        	<td colspan="6"> 
        		<span style="height:40px;line-height:40px;">￥:<input type="text" name="total" value="{$total}" readonly /></span>
        		<button type="submit" style="width:200px;height:40px;border:none;background:#DB453E;float:right;">结算</button>
        	</td>
        </tr>
        </form>
     </table>
     </div>
</block>